<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" exporter="bpmn-js (https://demo.bpmn.io)" exporterVersion="6.5.1">
  <bpmn:collaboration id="Collaboration_0memx95">
    <bpmn:participant id="Participant_1c0lpx5" processRef="Process_1hf9394" />
  </bpmn:collaboration>
  <bpmn:process id="Process_1hf9394" isExecutable="true">
    <bpmn:userTask id="task_clean" name="Clean">
      <bpmn:incoming>flow_gw1_clean</bpmn:incoming>
      <bpmn:outgoing>flow_clean_gw2</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:parallelGateway id="gateway_2">
      <bpmn:incoming>flow_repair_gw2</bpmn:incoming>
      <bpmn:incoming>flow_clean_gw2</bpmn:incoming>
      <bpmn:incoming>flow_gw1_gw2</bpmn:incoming>
      <bpmn:outgoing>flow_gw2_drive</bpmn:outgoing>
    </bpmn:parallelGateway>
    <bpmn:userTask id="task_repair" name="Repair">
      <bpmn:incoming>flow_gw1_repair</bpmn:incoming>
      <bpmn:outgoing>flow_repair_gw2</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:userTask id="task_Drive" name="Drive" camunda:candidateUsers="$data.starterUserId" camunda:dueDate="P10D" camunda:followUpDate="P5D">
      <bpmn:incoming>flow_gw2_drive</bpmn:incoming>
      <bpmn:outgoing>flow_drive_end</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:inclusiveGateway id="gateway_1" default="flow_gw1_gw2">
      <bpmn:incoming>flow_buy_gw</bpmn:incoming>
      <bpmn:outgoing>flow_gw1_repair</bpmn:outgoing>
      <bpmn:outgoing>flow_gw1_clean</bpmn:outgoing>
      <bpmn:outgoing>flow_gw1_gw2</bpmn:outgoing>
    </bpmn:inclusiveGateway>
    <bpmn:endEvent id="Event_19ebav7">
      <bpmn:incoming>flow_drive_end</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="flow_start_buy" sourceRef="StartEvent_158yep3" targetRef="task_Buy" />
    <bpmn:sequenceFlow id="flow_buy_gw" sourceRef="task_Buy" targetRef="gateway_1" />
    <bpmn:sequenceFlow id="flow_gw1_clean" sourceRef="gateway_1" targetRef="task_clean">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression" language="JavaScript">$(item.data.needsCleaning=="Yes")</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="flow_clean_gw2" sourceRef="task_clean" targetRef="gateway_2" />
    <bpmn:sequenceFlow id="flow_repair_gw2" sourceRef="task_repair" targetRef="gateway_2" />
    <bpmn:sequenceFlow id="flow_gw1_gw2" sourceRef="gateway_1" targetRef="gateway_2" />
    <bpmn:sequenceFlow id="flow_gw2_drive" sourceRef="gateway_2" targetRef="task_Drive" />
    <bpmn:sequenceFlow id="flow_gw1_repair" sourceRef="gateway_1" targetRef="task_repair">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression" language="JavaScript">$(item.data.needsRepairs=="Yes")</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="flow_drive_end" sourceRef="task_Drive" targetRef="Event_19ebav7" />
    <bpmn:userTask id="task_Buy" name="Buy" camunda:assignee="$(this.data.starterUserId)" camunda:candidateUsers="User1,User2" camunda:candidateGroups="Employee,Manager" camunda:dueDate="$this.dueDate" camunda:followUpDate="2023-10-31" camunda:priority="5">
      <bpmn:documentation>A User Task</bpmn:documentation>
      <bpmn:extensionElements>
        <camunda:formData>
          <camunda:formField id="needsRepairs" label="Repairs Required?" type="boolean" />
          <camunda:formField id="needsCleaning" label="Cleaning Required?" type="boolean" />
        </camunda:formData>
        <camunda:executionListener event="start">
          <camunda:script scriptFormat="JavaScript">var date=new Date();
date.setDate(date.getDate()+5);
this.dueDate=date.toISOString();</camunda:script>
        </camunda:executionListener>
        <camunda:taskListener event="validate">
          <camunda:script scriptFormat="JavaScript">item.vars=item.input;</camunda:script>
        </camunda:taskListener>
      </bpmn:extensionElements>
      <bpmn:incoming>flow_start_buy</bpmn:incoming>
      <bpmn:outgoing>flow_buy_gw</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:startEvent id="StartEvent_158yep3" camunda:initiator="starterUserId">
      <bpmn:extensionElements>
        <camunda:executionListener event="end">
          <camunda:script scriptFormat="JavaScript">data.startDate=this.startedAt;</camunda:script>
        </camunda:executionListener>
      </bpmn:extensionElements>
      <bpmn:outgoing>flow_start_buy</bpmn:outgoing>
    </bpmn:startEvent>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_0memx95">
      <bpmndi:BPMNShape id="Participant_1c0lpx5_di" bpmnElement="Participant_1c0lpx5" isHorizontal="true">
        <dc:Bounds x="152" y="37" width="704" height="250" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="flow_drive_end_di" bpmnElement="flow_drive_end">
        <di:waypoint x="766" y="166" />
        <di:waypoint x="800" y="166" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="737" y="141" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="flow_gw1_repair_di" bpmnElement="flow_gw1_repair">
        <di:waypoint x="396" y="141" />
        <di:waypoint x="396" y="96" />
        <di:waypoint x="456" y="96" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="366" y="109" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="flow_gw2_drive_di" bpmnElement="flow_gw2_drive">
        <di:waypoint x="651" y="166" />
        <di:waypoint x="666" y="166" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="614" y="141" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="flow_gw1_gw2_di" bpmnElement="flow_gw1_gw2">
        <di:waypoint x="421" y="166" />
        <di:waypoint x="601" y="166" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="466" y="141" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="flow_repair_gw2_di" bpmnElement="flow_repair_gw2">
        <di:waypoint x="556" y="96" />
        <di:waypoint x="626" y="96" />
        <di:waypoint x="626" y="141" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="546" y="71" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="flow_clean_gw2_di" bpmnElement="flow_clean_gw2">
        <di:waypoint x="556" y="226" />
        <di:waypoint x="626" y="226" />
        <di:waypoint x="626" y="191" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="546" y="201" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="flow_gw1_clean_di" bpmnElement="flow_gw1_clean">
        <di:waypoint x="396" y="191" />
        <di:waypoint x="396" y="226" />
        <di:waypoint x="456" y="226" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="366" y="199" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="flow_buy_gw_di" bpmnElement="flow_buy_gw">
        <di:waypoint x="350" y="170" />
        <di:waypoint x="361" y="170" />
        <di:waypoint x="361" y="166" />
        <di:waypoint x="371" y="166" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="314" y="141" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="flow_start_buy_di" bpmnElement="flow_start_buy">
        <di:waypoint x="224" y="170" />
        <di:waypoint x="250" y="170" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="190" y="141" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Activity_1kzuj3t_di" bpmnElement="task_clean">
        <dc:Bounds x="456" y="186" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Gateway_0jp9aj3_di" bpmnElement="gateway_2">
        <dc:Bounds x="601" y="141" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="581" y="191" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0pn5s0l_di" bpmnElement="task_repair">
        <dc:Bounds x="456" y="56" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_02ehn3y_di" bpmnElement="task_Drive">
        <dc:Bounds x="666" y="126" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="InclusiveGateway_0ea77jj_di" bpmnElement="gateway_1">
        <dc:Bounds x="371" y="141" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="306" y="191" width="90" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_19ebav7_di" bpmnElement="Event_19ebav7">
        <dc:Bounds x="800" y="148" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="771" y="184" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1bp4iyj_di" bpmnElement="task_Buy">
        <dc:Bounds x="250" y="130" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_158yep3">
        <dc:Bounds x="188" y="152" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="161" y="184" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
